package com.sky.mapper;

import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserShoppingCartMapper {

    @Select("select id, name, image, user_id, dish_id, setmeal_id, dish_flavor, number, amount, create_time" +
            " from shopping_cart where user_id = #{userId}")
    List<ShoppingCart> selectShoppingCart(Long userId);

    void insertShoppingCart(ShoppingCart shoppingCart);

    Integer selectCountInShoppingCartById(ShoppingCart shoppingCart);

    void updateByIdInsert(ShoppingCart shoppingCart);

    void updateByIdDelete(ShoppingCart shoppingCart);

    Integer selectShoppingCartNumberById(ShoppingCart shoppingCart);

    void deleteById(ShoppingCart shoppingCart);

    void cleanShoppingCart(Long currentId);

    ShoppingCart selectById(ShoppingCart shoppingCart);

    void updateById(ShoppingCart shoppingCartQuery);

    void insertBatch(List<ShoppingCart> shoppingCartList);
}
